package com.qzct.mapper;

import com.mybatisflex.core.BaseMapper;
import com.qzct.entity.CuisineComments;
import com.qzct.entity.vo.CommentsVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.io.Serializable;
import java.util.ArrayList;

/**
 *  映射层。
 *
 * @author 闽闽
 * @since 2025-01-11
 */
public interface CuisineCommentsMapper extends BaseMapper<CuisineComments> {
    @Select("SELECT comment_content as 'commentContent',`name`,image FROM `tb_cuisine_comments` INNER JOIN tb_user ON tb_cuisine_comments.user_id = tb_user.uid WHERE cuisine_id = #{id} and is_check = 1")
    ArrayList<CommentsVo> getCid(@Param("id") Serializable id);
    @Update("update tb_cuisine_comments set is_check = 1 where comments_id = #{id}")
    boolean updateIscheck(@Param("id") Serializable id);
}
